package com.water.camera.view;

import android.content.Context;
import android.view.View;
import android.view.ViewGroup;

import androidx.viewpager.widget.PagerAdapter;

import com.ogaclejapan.smarttablayout.SmartTabLayout;

import java.util.List;

public class CustomTabProvider implements SmartTabLayout.TabProvider {

    private final Context context;
    private List<String> list;
    private boolean withImg = false;

    public CustomTabProvider(Context context) {
        this.context = context;
    }

    public void setImages(List<String> list) {
        withImg = true;
        this.list = list;
    }

    @Override
    public View createTabView(ViewGroup container, int position, PagerAdapter adapter) {
        CustomTabView tabView = new CustomTabView(context);
        tabView.binding.tv.setText(adapter.getPageTitle(position));
        return tabView;
    }
}
